﻿
@{
    ViewBag.Title = "GetOrderDetail4Admin";
    Layout = "~/Views/Shared/_Layout.cshtml";
}

<br />
<p>请选择查询项目</p>
<form class="" action="/Jorder/searchorder?z=1" method="post">
    <div class="mui-input-row mui-radio mui-left">
        <label>维修订单查询</label>
        <input name="project" type="radio" value="0">
    </div>
    <div class="mui-input-row mui-radio mui-left">
        <label>回收订单查询</label>
        <input name="project" type="radio" checked value="1">
    </div>

<br />
<p>请输入手机号进行查询</p>
<div class="mui-input-row mui-search">
    <input type="search" class="mui-input-clear" placeholder="" name="key">
</div>
<button type="submit" class="mui-btn mui-btn-block ">点击搜索</button>
</form>
<br />
<p>查询结果</p>
@{

    if (ViewBag.project == 0)
    {
        IEnumerable<Developer.Entity.RepairOrderDetail> Model = (IEnumerable<Developer.Entity.RepairOrderDetail>)ViewBag.result;
        foreach (var item in Model)
        {
                        <ul class="mui-table-view">
                            <li class="mui-table-view-cell mui-collapse">
                                <a class="mui-navigate-right">@item.RepairOrder.FirstOrDefault().CreateTime</a>
                                <ul class="mui-table-view">
                                    <li class="mui-table-view-cell">
                                        <p>订单号：@item.Num</p>
                                        
                                    </li>
                                    <li class="mui-table-view-cell">
                                        <p>设备类型:@item.RepairColor.RepairModel.RepairBrand.RepairType.Name</p>
                                        <p>设备品牌:@item.RepairColor.RepairModel.RepairBrand.Name</p>
                                        <p>设备型号:@item.RepairColor.RepairModel.Name</p>
                                        <p>设备颜色：@item.RepairColor.Name</p>
                                        <p>申报故障：@item.Problem</p>
                           
                                    </li>
                       @if(item.VideoUrl != null)
            {
                                    <li class="mui-table-view-cell">
                                        <p>视频录像：</p>
                                        <p>@item.VideoUrl</p>
                                    </li>

                       }
                                </ul>
                            </li>
               
                        </ul>

        }
    }
    else if(ViewBag.project == 1)
    {
        IEnumerable<Developer.Entity.CycleOrderDetail> Model = (IEnumerable<Developer.Entity.CycleOrderDetail>)ViewBag.result;
        foreach (var item in Model)
        {
                <ul class="mui-table-view">
                    <li class="mui-table-view-cell mui-collapse">
                        <a class="mui-navigate-right">@item.CycleOrder.FirstOrDefault().CreateTime</a>
                        <ul class="mui-table-view">
                            <li class="mui-table-view-cell">
                                <p>订单号：@item.Num</p>
                                
                            </li>
                            <li class="mui-table-view-cell">
                                <p>设备类型:@item.CycleModel.CycleBrand.CycleType.Name</p>
                                <p>设备品牌:@item.CycleModel.CycleBrand.Name</p>
                                <p>设备型号:@item.CycleModel.Name</p>
                                <p>申报故障：@item.Poblem</p>

                            </li>
                            @if (item.VideoUrl != null)
                            {
                                <li class="mui-table-view-cell">
                                    <p>视频录像：</p>
                                    <a href="@item.VideoUrl" target="_blank"> <p>@item.VideoUrl</p></a>
                                </li>

                            }
                        </ul>
                    </li>

                </ul>

            }
        }


}

